package com.zk.shop.servlet.user;


import com.zk.shop.util.JSONServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * @ClassName LoginOutServlet
 * @Description TODO
 * @Author 来永刚
 * @Date 2019/10/14 0014下午 4:27
 * @Version 1.0
 **/
@WebServlet("/user/LoginOutServlet")
public class LoginOutServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        if (req.getSession()!=null) {
            req.getSession().invalidate();
        }
        JSONServlet.getJson(req,resp,true);
    }
}
